package com.automannn.springboot.practice.propertySourceLoader;

import org.springframework.boot.env.YamlPropertySourceLoader;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.util.List;

/**
 * @author chenkh
 * @time 2021/10/8 14:18
 */
public class PropertySourceLoaderTest {
    public static void main(String[] args) throws IOException {
//        PropertySourceLoader propertySourceLoader= new PropertiesPropertySourceLoader();

        YamlPropertySourceLoader yamlPropertySourceLoader = new YamlPropertySourceLoader();
        Resource resource = new ClassPathResource("myTest.yml");
       List<PropertySource<?>> propertySources= yamlPropertySourceLoader.load("myConfigSource",resource);
        System.out.println(propertySources);
    }
}
